package com.gitee.wsl.mathematics.complex.quaternion.ext

import com.gitee.wsl.mathematics.complex.quaternion.Quat

/**
 * This quaternion's reciprocal.
 */
val Quat.reciprocal: Quat
    get() {
        val norm2 = (w * w + x * x + y * y + z * z)
        return Quat(w / norm2, -x / norm2, -y / norm2, -z / norm2)
    }